
package sanmubird.club.mock.dao.orm;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import sanmubird.club.mock.dao.beans.UserPo;

import java.util.List;

/**
 * @author Sam
 */
@Repository
public class UserRepository {

	@Autowired
	private UserMapper userMapper;

	public int save(UserPo userPo) {
		return userMapper.insert(userPo);
	}

	public int delete(UserPo userPo) {
		LambdaQueryWrapper<UserPo> lambdaQueryWrapper = new LambdaQueryWrapper<>(userPo);
		return userMapper.delete(lambdaQueryWrapper);
	}

	public List<UserPo> selectList(UserPo userPo) {
		LambdaQueryWrapper<UserPo> lambdaQueryWrapper = new LambdaQueryWrapper<>(userPo);
		return userMapper.selectList(lambdaQueryWrapper);
	}

}
